<template>
	<view>
		<!-- 顶部导航部分 -->
		<view class="top">
			<view class="bg"></view>
			<view class="title_header">
				<view class="jiantou" @click="back"></view>
				<text>活动发布</text>
			</view>
		
		
		
		<!-- 已上架和未上架内容 -->
		<view class="padding">
			<uni-card>
				<view class="uni-padding-wrap">
					<uni-segmented-control :current="current" :values="items" :style-type="styleType"
						:active-color="activeColor" @clickItem="onClickItem" />
				</view>
				<view class="content"  >
					<!-- 已上架部分 -->
					<!-- <view class="content1"  v-if="current === 0 && item.state==0" v-for="(item,index) in ActiveList"> -->
						 <view class="content1"  v-if="current === 0 " >
							<view class="upjia" >
								<!-- 左边部分 -->
								<view class="left">
									
									<view class="title" @click="active_detail">阳春三月油江南活动开始报名了</view>
									<view class="time">
										<text class="data">2023-03-10 11:09</text>
									</view>
									
									<view class="title" @click="active_detail">阳春三月油江南活动开始报名了</view>
									<view class="time">
										<text class="data">2023-03-10 11:09</text>
									</view>
									
								</view>
							
								<!-- 右边部分 -->
								<view>
								<view class="xiajia">
									下架
								</view>
								<view class="xiajia">
									下架
								</view>
								</view>
							</view>
					</view>
					
					<!-- 未上架部分 -->
					<!-- <view class="content1"  v-if="current === 1 && item.state==1" v-for="(item,index) in ActiveList" > -->
					<view class="content1"  v-if="current === 1 " >
						<view class="upjia">
							<!-- 左边部分 -->
							<view class="left">
								<!-- <view class="title" @click="active_detail">{{item.title}}</view> -->
								<view class="title" @click="active_detail">阳春三月油江南活动开始报名了</view>
								<!-- <view class="shenhe" v-if="item.type==0" >审核中</view> -->
								<view class="shenhe">审核中</view>
								<!-- <view class="shenhe  green" v-if="item.type==1" >审核成功</view>
								<view class="shenhe  grey" v-if="item.type==2" >审核失败</view> -->
								<view class="time">
									<text class="data">2023-03-10 11:09</text>
								</view>
								
								<view class="title" @click="active_detail">阳春三月油江南活动开始报名了</view>
								
								<view class="shenhe  green" >审核成功</view>
								
								<view class="time">
									<text class="data">2023-03-10 11:09</text>
								</view>
								
								<view class="title" @click="active_detail">阳春三月油江南活动开始报名了</view>
								
								<view class="shenhe  grey" >审核失败</view> 
								
								<view class="time">
									<text class="data">2023-03-10 11:09</text>
								</view>
								
								
							</view>
							
							
							<!-- 右边部分 -->
							<!-- <view class="xiajia  xiajia1"  v-if="item.type==0"> -->
							<view>
								
							<view class="xiajia  xiajia1" >
								删除
							</view>
							
							<view class="xiajia  xiajia1">
								上架
							</view>
							
							<view class="xiajia  xiajia1" >
								删除
							</view>
							
							</view>
							
							<!-- <view class="xiajia  xiajia1"  v-if="item.type==2">
								删除
							</view>
							<view class="xiajia  xiajia1"  v-if="item.type==1">
								上架
							</view> -->
						</view>
					</view>
				</view>
			</uni-card>
		</view>
		
		
		<!-- 点击发布按钮 -->
		<view class="fabu" @click="publish_active">
			<image src="../../static/image/加号.png"></image>
			发布活动
		</view>
	</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				/* 关于已上架未上架的数据 */
				items: ['已上架', '未上架'],
				activeColor: '#007aff',
				styleType: 'button',
				current: 1,
				
				//关于接口的数据定义
				ActiveList:{}
			}
		},
		onLoad() {
			this.ActiveLaunch();
		},
		onShow(){
			this.ActiveLaunch();
		},
		methods: {
			//此页面的接口调用
			ActiveLaunch(){
				uni.request({
					url:" http://localhost:8080/seller/ActiveLaunch/displayDate",
					data:{},
					method:'POST',
					header: {
					    'Authorization':'Bearer '+getApp().globalData.userInfo.token
					},
					success: (res) => {
						console.log("活动发布页面数据:",res)
						this.ActiveList = res.data.rows
					}
				})
			},
			
			
			onClickItem(e) {
				if (this.current !== e.currentIndex) {
					this.current = e.currentIndex
				}
			},
			// 活动发布点击箭头返回上页
			back(){
				uni.navigateBack({
					delta:1
				})
			},
			// 点击发布活动跳转页面
			publish_active(){
				uni.navigateTo({
					url:"/pages/activelaunch/activelaunch"
				})
			},
			//点击活动标题跳转到活动详情页面
			active_detail(){
				uni.navigateTo({
					url:"/pages/activedetail/activedetail"
				})
			}
		}
	}
</script>

<style>
	/* 导航栏样式 */
	.top{
		width: 750rpx;
		height: 400rpx;
		background-color: #3785f6;
	}
	.bg{
		position: absolute;
		z-index: -1;
		background-color: #3785f6;
		width: 750rpx;
		height: 450rpx;
	}
	.title_header{
		display: flex;
		padding-top: 60rpx;
	}
	.title_header>text{
		font-size: 35rpx;
		color: white;
		margin-left: 270rpx;
	}
	.jiantou{
		border-bottom: 6rpx solid white;
		border-left: 6rpx solid white;
		width: 20rpx;
		height: 20rpx;
		margin-left: 20rpx;
		transform: rotate(45deg);
	}
	
	/* 已上架未上架样式样式 */
	
	.uni-padding-wrap {
		margin-top: 15px;
		width: 350rpx;
		padding: 0px 68px;
		margin-bottom: 20rpx;
		padding-bottom: 15rpx;
		/* border-bottom: 3rpx solid #e5e5e4; */
	}
	.segmented-control__item--button--first {
	    border-top-left-radius: 20px !important;
	    border-bottom-left-radius: 20px !important;
	}
	.segmented-control__item--button--last {
		border-top-right-radius: 20px !important;
		border-bottom-right-radius: 20px !important;
	}
	
	/* 卡片内容样式 */
	.upjia{
		display: flex;
		border-top: 3rpx solid #e5e5e4;
		margin-top: 20rpx;
		padding-top: 8rpx;
	}
	.left{
		margin-top: 10rpx;
	}
	.upjia .title{
		width: 420rpx;
		color: black;
		font-size: 30rpx;
		margin-bottom: 20rpx;
	}
	.xiajia{
		display: flex;
		width: 170rpx;
		height: 55rpx;
		border: 1rpx solid white;
		/* margin-top: 40rpx; */
		margin-top: 45rpx;
		margin-left: 40rpx;
		border-radius: 30rpx;
		justify-content: center;
		align-items: center;
		background-color: #0863e7;
		color: white;
	}
	.xiajiaa{
		display: flex;
		width: 170rpx;
		height: 55rpx;
		border: 1rpx solid white;
		margin-top: 40rpx;
		margin-left: 40rpx;
		border-radius: 30rpx;
		justify-content: center;
		align-items: center;
		background-color: #0863e7;
		color: white;
	}
	.xiajia1{
		margin-top: 95rpx;
		
		/* margin-top: 65rpx; */
		
		
	}
	
	.left .green{
		color: green;
	}
	.left .grey{
		color: #8c8c8b;
	}
	.shenhe{
		color: #df643f;
		margin-bottom: 15rpx;
	}
	
	
	
	.time{
		margin-bottom: 5rpx;
	}
	.time .data{
		margin-right: 15rpx;
	}
	
	
	
	/* 发布按钮样式 */
	.fabu{
		line-height: 77rpx;
		width: 517rpx;
		height: 70rpx;
		border: 1rpx solid  white;
		border-radius: 30rpx;
		color: white;
		background-color: #0863e7;
		display: flex;
		justify-content: center;
		align-items: center;
		margin: 0 auto;
	}
	.fabu image{
		width: 30rpx;
		height: 30rpx;
		padding-right: 10rpx;
	}

</style>
